using Castle.ActiveRecord;

namespace Cooking.Core.Model
{
    [ActiveRecord]
    public class RecipeIngredient
    {
        public RecipeIngredient()
        {
        }

        public RecipeIngredient(Ingredient ingredient, string unitOfMeasure, decimal quantity, string prep)
        {
            Ingredient = ingredient;
            UnitOfMeasure = unitOfMeasure;
            Quantity = quantity;
            IngredientPrep = prep;
        }

        [PrimaryKey(Generator = PrimaryKeyType.Increment)]
        public int Id { get; set; }

        [BelongsTo(Cascade = CascadeEnum.All)]
        public Ingredient Ingredient { get; set; }

        [Property]
        public string UnitOfMeasure { get; set; }

        [Property]
        public decimal Quantity { get; set; }

        [Property]
        public string IngredientPrep { get; set; }

        [BelongsTo("RecipeId")]
        public Recipe BelongsTo { get; set; }
    }
}